﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zhao.Common.Helper;
using Zhao.Models.DTO;
using Zhao.Models.Entity;

namespace Zhao.IServer.menu
{
    public interface IMenusServer: IBaseService<Menus>
    {
        /// <summary>
        /// 分页查询菜单
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="keywords"></param>
        /// <returns></returns>
        public Task<PageModel<Menus>> GetMenuTreePageAsync(int pageIndex, int pageSize, string? keywords);

        /// <summary>
        /// 多处使用
        /// 1、作为菜单修改项目----需要传递Id 来过滤掉当前菜单的选项和子选项
        /// 2、查询路由数据---不用传值；就查询所有的数据
        /// <param name="Id"></param>
        /// <returns></returns>
        public Task<List<Menus>> GetMenuTreeAsync(Guid menuId=default);

        /// <summary>
        /// 修改或者新增菜单
        /// </summary>
        /// <param name="menudto"></param>
        /// <returns></returns>
        public Task<ApiResult> AddOrUpdateMenuAsync(MenuDTO menudto);

        
        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="menuId"></param>
        /// <returns></returns>
        public Task<bool> DelMenuAsync(Guid menuId);

        /// <summary>
        /// 获取菜单树列表,根据用户归属来获取
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public Task<List<Menus>> GetMenusTreeList(int userId);
    }
}
